﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StackExchangeApi
{
    /// <summary>
    /// Marks a field as backing a cache.
    /// 
    /// When a cache is cleared, the so marked field of type T
    /// should be set to default(T)
    /// </summary>
    [AttributeUsage(AttributeTargets.Field)]
    internal sealed class BacksCache : Attribute
    {
        public BacksCache() { }
    }

    /// <summary>
    /// All classes implementing this interface
    /// aggressively cache some data.
    /// 
    /// The exposed methods allow for this data to be
    /// disposed of, in the event that new data is
    /// requested.
    /// </summary>
    public interface ICached
    {
        /// <summary>
        /// Call to clear the cache of all
        /// properties on the implementing object
        /// which are backed by SXAPI's aggressive
        /// caching system.
        /// </summary>
        void Clear();
    }
}
